<#compress>
    <#assign actionname>${(action=='create')?string('新建','编辑')}</#assign>
    <@override name="title">${actionname}问卷调查</@override>
    <@override name="viewbody">
    <div class="row">
        <div class="col-md-12">
            <h3 class="page-title">
            ${actionname}问卷管理
                <small>${actionname}新建问卷</small>
            </h3>
            <ul class="page-breadcrumb breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="${ctx}/admin/home">
                        首页
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="${ctx}/admin/vote/vote">
                        问卷管理
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">
                    ${actionname}问卷管理
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading"><h6 class="panel-title">问卷信息</h6></div>
        <div class="panel-body">
            <form class="form-horizontal" action="${ctx}/admin/vote/vote/save" role="form" id="voteForm"
                  method="post">
                <input name="vote.id" type="hidden" value="${(vote.id)!}"/>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="brandName">题目: <span
                            class="required">*</span></label>

                    <div class="col-sm-10">
                        <input type="text" class="required form-control input-xlarge" placeholder="问卷题目"
                               name="vote.title" id="brandName" value="${(vote.title)!}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="rule.description">选项:  <span
                            class="required">*</span></label>
                    <div class="col-sm-10">
                        <textarea class="required form-control" rows="6" name="vote.opt">
                            <#if optList??>
                                <#list optList as list>
                                    ${list}
                                </#list>
                            </#if>
                        </textarea>
                        <span class="help-block" id="optdesc">请输入多个选项，每一行代表一个选项.</span>
                    </div>
                </div>


                <div class="form-group">
                    <label class="col-sm-2 control-label" for="floor_mall">所属标题: </label>
                    <div class="col-sm-10">
                        <select data-placeholder="选择所属标题" name="vote.category" id="vote.category"
                                class="required form-control input-xlarge select2me">
                                <option value=""></option>
                                <#list catetorys! as cat>
                                    <option value="${cat.id!}" <#if vote.category?? && vote.category == cat.id >selected="selected" </#if>>${cat.name!}</option>
                                </#list>
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="category.enable">单选/多选: <span class="required">*</span></label>
                    <div class="col-sm-10 radio-list">
                        <label class="radio-inline">
                            <input type="radio" name="vote.style" id="category.enable" value="0" <#if vote.style?? &&vote.style==0>checked</#if>> 单选 </label>
                        <label class="radio-inline">
                            <input type="radio" name="vote.style" id="category.enable" value="1" <#if vote.style?? &&vote.style==1>checked</#if>> 多选 </label>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="begin_time">开始时间: <span
                            class="mandatory">*</span></label>

                    <div class="col-sm-10">
                        <div class="input-group input-medium date form_datetime" data-link-field="begin_time">
                            <input class="form-control" size="16" type="text" value="${(vote.begin_time)!}" name="vote.begin_time"
                                   id="begin_time">
                            <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                            <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                        </div>
                        <input type="hidden" id="vote.begin_time" name="begin_time" value="">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="end_time">结束时间: <span class="mandatory">*</span></label>

                    <div class="col-sm-9">
                        <div class="input-group input-medium date  form_datetime" data-link-field="end_time">
                            <input class="form-control" size="16" type="text" value="${(vote.end_time)!}"
                                   name="vote.end_time" id="end_time">
                            <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                            <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                        </div>
                        <input type="hidden" id="vote.end_time" name="end_time" value=""/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="spinner1">次序: <span class="mandatory">*</span></label>
                    <div class="col-sm-9">
                        <div id="spinner1">
                            <div class="input-group input-small">
                                <input type="text" class="spinner-input form-control" name="vote.sequence" value="${vote.sequence!}" maxlength="3" readonly>
                                <div class="spinner-buttons input-group-btn btn-group-vertical">
                                    <button type="button" class="btn spinner-up btn-xs blue">
                                        <i class="fa fa-angle-up"></i>
                                    </button>
                                    <button type="button" class="btn spinner-down btn-xs blue">
                                        <i class="fa fa-angle-down"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-actions text-right">
                    <a class="btn default yellow-stripe" href="${ctx}/admin/vote/vote"><i
                            class="fa fa-arrow-circle-o-left"></i> 返回</a>
                    <input type="submit" value="保存" class="btn btn-primary">
                </div>

            </form>
        </div>

    </div>
    </@override>

    <@override name="viewmodule">vote_item</@override>
    <@extends name="../../_basic/main.ftl"></@extends>
</#compress>